﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCFirePortection.ascx.cs"
    Inherits="MTRC.ODMS.Web.SOM.UserControl.UCFirePortection" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" %>
<link id="cssWait" rel="stylesheet" type="text/css" />
<%--Remove by jack 20151127 U278 when change drop down list of fire link in firelinkentry page, it ocurs a exception in win log--%>
<%--<link href="<%=ResolveUrl("~/CSS/common.css")%>" rel="stylesheet" type="text/css" />--%>
<%--End remove by jack 20151127 U278 when change drop down list of fire link in firelinkentry page, it ocurs a exception in win log--%>
<script type="text/jscript" language="JavaScript" src="../../Javascript/CommonFunction.js"></script>
<script src="../../jQuery/jquery-1.6.2.min.js" type="text/javascript"></script>
<style type="text/css">
        .spanLable
        {
            width:102px;
            padding-left:8px;
            display:inline-block;
        }
        
        .liStyle
        {
      <%--      padding-top:8px;--%>
            list-style-position : inside;
            list-style : disc outside ; 
            list-style-type : -;
        }
        
        .Isolation
        { 
            cursor: hand;
            color:Red;
        }
        
        .Restore
        {
            cursor: hand;
            color:green;
        }
        
        .Normal
        {
            cursor: hand;
            color:Black;
        }
        
        .Test
        {
            cursor: hand;
            color:yellow;
        }
        
        .IsolationLable
        {
            color:Red;
        }
        
        .RestoreLable
        {
            color:green;
        }
        
        .NormalLable
        {
            color:Black;
        }
        
        .TestLable
        {
            color:yellow;
        }
        
        .FireZoneGroupTD
        {
            width:46px;
        }
        
    </style>
<script type="text/javascript">
    var readOnly = '<%=this.ReadOnly%>';
    var canAmend = '<%=this.CanAmendTime%>';
    var eventIDs = '<%=this.AllIsolateStationEventIDs%>';
    var canChangeStatus = '<%=this.CanChangeStatus %>';
    var action = '<%=this.Action %>';
    var RestoreNormalStatus = '<%=this.RestoreNormalStatus %>';
    var stationEventID = '<%=this.StationEventID %>';
    var eventStatus = '<%=this.EventStatusID %>';
    //------------------ Add at 2008-12-8 (action log 0736)----------------

    function SaveCheckExistIsolate(message) {
        if (action == 1) {
            //                return true;
            return processing(true);
        }

        var hidAutomaticallyAssignTestoreTime = document.getElementById('UCFirePortection1$hidAutomaticallyAssignTestoreTime');
        var objTable = document.getElementById('tIsolation');
        var checkResult = 0;
        hidAutomaticallyAssignTestoreTime.value = 0;

        if (objTable != null) {
            for (i = 0; i < objTable.getElementsByTagName("INPUT").length; i++) {
                var objInputValue = objTable.getElementsByTagName("INPUT")[i].value;

                if (parseInt(objInputValue) == 2) {
                    checkResult = 1;
                    break;
                }
            }
        }

         //Modify by tim 20160309 for Restore fire link
         //if (checkResult == 0 && document.getElementById("UCFirePortection1_rblStatus_0").checked && !document.getElementById('UCFirePortection1_chkRestoreNormal').checked && stationEventID !=1)
        if (checkResult == 0 && document.getElementById("UCFirePortection1_rblStatus_0").checked && !document.getElementById('UCFirePortection1_chkRestoreNormal').checked && stationEventID > 0) {
            if (confirm(message)) {
                hidAutomaticallyAssignTestoreTime.value = 1;

                //                    return true;
                return processing(true);
            }
            else {
                return false;
            }
        }


        //            return true;
        return processing(true);
    }

    //------------------ End add at 2008-12-8 ----------------        

    if (readOnly == 'True' || canAmend == 'False') {
        //            debugger;

        canAmend = 'True';
    }
    else {
        canAmend = 'False';
    }

    function changeClick(obj, mes, otherUrl) {
        var canChange = 0
        //            var haveParent = '<%=this.HaveParent%>'

        //            alert(readOnly+haveParent);

        if (readOnly != 'True' || canChangeStatus == 'True')// && haveParent != 'True'
        {
            var strID = 'txt' + obj.id.substring(3, 8);
            var txtObj = document.getElementById(strID);
            var dataObj = document.getElementById('UCFirePortection1$txtFireZonePanelData');
            var restoreAll = document.getElementById('UCFirePortection1_chkRestoreAll');
            var isolateAll = document.getElementById('UCFirePortection1_chkIsolateAll');

            restoreAll.checked = false;
            isolateAll.checked = false;

            if (otherUrl.length > 1 && txtObj.value == "2") {
                //Issue U40:Update By Gordon 2015/05/29
                //                    if(confirm(mes))
                //                    {
                //    //                    window.location.replace(otherUrl);
                //                          var newwin=window.open("","","scrollbars=yes, toolbar=yes, menubar=yes, location=yes, status=yes, resizable=yes");
                //                          if (document.all)
                //                          {   
                //                            newwin.moveTo(0,0);   
                //                            newwin.resizeTo(screen.width,screen.height - 25);
                //                          }   
                //                          newwin.location=otherUrl; 
                ////                          window.showModalDialog(otherUrl, window, "DialogWidth:800px;DialogHeight:600px;help:no;status:no");
                //                    }
                alert(mes);
            }
            //            else
            //            {

            if (txtObj.value == "3") {
                txtObj.value = "2";
                dataObj.value = dataObj.value + obj.id.substring(3, 8) + ':2,'
                //                    obj.innerHTML = obj.innerText.substring(0,4)+'[X]';
                obj.innerHTML = obj.innerText.replace("[]", '[X]');

                obj.className = "Isolation";
            }
            else if (txtObj.value == "1") {
                txtObj.value = "2";
                dataObj.value = dataObj.value + obj.id.substring(3, 8) + ':2,'
                //                    obj.innerHTML = obj.innerText.substring(0,4)+'[X]';
                obj.innerHTML = obj.innerText.replace("[]", '[X]');

                obj.className = "Isolation";
            }
            else if (txtObj.value == "2") {
                txtObj.value = "3";
                dataObj.value = dataObj.value + obj.id.substring(3, 8) + ':3,'
                //                    obj.innerHTML = obj.innerText.substring(0,4)+'[]';
                obj.innerHTML = obj.innerText.replace("[X]", '[]');

                obj.className = "Restore";
            }
            //            }
        }
    }

    //
    function ResorteAll(sender, url, mes, mes2) {
        //            debugger;

        if (confirm(mes2)) {
            if (sender.checked) {
                //Issue U40:Update By Gordon 2015/05/29
                //                    if(eventIDs.length >0 && confirm(mes))
                //                    {
                //                        var strURL = url + eventIDs;
                //                        //--------------- Modify 2009-03-19 change modaldialog to normal form --------------
                //                        //window.showModalDialog(strURL, window, "DialogWidth:1012px;DialogHeight:758px;help:no;status:no");
                //                          
                //                          var newwin=window.open("","","scrollbars=yes, toolbar=yes, menubar=yes, location=yes, status=yes, resizable=yes");
                //                          if (document.all)
                //                          {   
                //                            newwin.moveTo(0,0);   
                //                            newwin.resizeTo(screen.width,screen.height - 25);
                //                          }   
                //                          newwin.location=strURL; 
                //                          
                //                       //--------------- End Modify 2009-03-19 change modaldialog to normal form --------------
                //                          
                //                    }
                if (eventIDs.length > 0) {
                    alert(mes);
                }

            }
            __doPostBack(sender.id, "");

            return true;
        }
        else {
            return false;
        }
    }

    //resort normal.
    function ResortNormalCheck(sender, url, mes) {
        //            debugger;

        //Issue U40:Update By Gordon 2015/05/29
        //            if(eventIDs.length >0 && confirm(mes))
        //            {
        //                var strURL = url + eventIDs;
        //                window.showModalDialog(strURL, window, "DialogWidth:1012px;DialogHeight:758px;help:no;status:no");
        //            }
        if (eventIDs.length > 0) {
            alert(mes);
        }
        return true;
    }


    function CheckIsolateAll(sender, mes) {
        if (confirm(mes)) {
            __doPostBack(sender.id, "");

            return true;
        }
        else {
            return false;
        }
    }


    function chkHandoerClick(sender, mes) {
        var obj = document.getElementById('UCFirePortection1$txtHandoverNote');


        if (obj.value.length > 0) {
            if (confirm(mes)) {
                obj.value = '';
            }
            else {
                sender.checked = true;
                return false;
            }
        }

        __doPostBack(sender.id, "");

        return true;
    }

    function OpenStaffByRequest()//Request by
    {
        //           document.getElementById("UCFirePortection1$hdnLastID").value='UCFirePortection1$btnSelectRequest';
        var strURL = "../Popup/PopupSearchStaff.aspx?PageID=FireProtectionEntryRequestBy"
        window.showModalDialog(strURL, window, "DialogWidth:740px;DialogHeight:520px;help:no;status:no");
        staffid = document.getElementById("UCFirePortection1_txtRequestByID").value;
    }

    //Responsible
    function OpenStaffByResponsible() {
        var strURL = "../Popup/PopupSearchStaff.aspx?EventPersonTypeID=1&PageID=FireProtectionEntryResponsibleBy" //show staff
        window.showModalDialog(strURL, window, "DialogWidth:740px;DialogHeight:520px;help:no;status:no");
    }

    function OpenAmendEventTimeForm() {
        //            document.getElementById("UCFirePortection1$hdnLastID").value='UCFirePortection1$btnAmendEventTime';
        var strURL = "../Popup/SetRegEventTime.aspx?PageID=FireProtectionEntry&ReadOnly=" + canAmend + "&StationEventID=<% =this.StationEventID  %>&TimeType=1";

        //update by gordon 20160226 - GE Allow user to amend the description even if the event has been compelted
        //        window.showModalDialog(strURL, window, 'dialogHeight:610px;dialogWidth:830px,center:yes,resizable:no,scroll:no,status:no');
        window.showModalDialog(strURL, window, 'dialogHeight:610px;dialogWidth:830px;center:yes;resizable:no;scroll:no;status:no');
        //            alert(document.getElementById('hdnDateTimeReason').value);
        return false;
    }

    function InitSettingHandovernote() {
        var obj = document.getElementById('UCFirePortection1$txtHandoverNote');
        var chk = document.getElementById('UCFirePortection1$chkHandoverNot');

        if (chk.checked) {
            obj.readOnly = false;
        }
        else {
            obj.readOnly = true;
        }
    }

    function CheckIsExsitIsolate(msg) {
        var res = true;
        var tableIsolation = document.getElementById("tIsolation");

        if (tableIsolation != null) {
            var txtStatus = tableIsolation.getElementsByTagName("Input");

            for (var i = 0; i < txtStatus.length; i++) {
                if (parseInt(txtStatus[i].value) == 2) {
                    res = false;
                    alert(msg);
                    break;
                }
            }
        }

        if (res) {
            window.__doPostBack("UCFirePortection1_chkRestoreNormal", "");
        }

        return res;
    }

    //------------------------------ Issue U23: Add by Gordon 2015/05/21
    //------------------------------ Issue U106: Add By Gordon 20150630
    function SetDefaultValueToRemark() {
        //parent property
        var parentWin = window.dialogArguments;
        if (parentWin != null && action == 1) {
            var tnlbl = parentWin.document.getElementById("lblTNNumber").innerText;
            var translbl = parentWin.document.getElementById("lblTransactionNumber").innerText;
            var tnlVal = trim(parentWin.document.getElementById("txtTNNumber").value);
            var transVal = trim(parentWin.document.getElementById("txtTransactionNumber").value);

            //Sub
            //UCFireProtection1_txtRemarks
            var txtRemark = document.getElementById("UCFirePortection1_txtRemarks");
            var strRemark = "";
            if (tnlVal != "") {
                strRemark += tnlbl + " " + tnlVal + ";"
            }
            if (strRemark != "") {
                strRemark += "\r\n";
            }
            if (transVal != "") {
                strRemark += translbl + " " + transVal + ";"
            }
            txtRemark.value = strRemark;
        }
    }


    //------------------------------ ------------------------------------

    //------------------------------ U36 Add By Gordon 20150707
    function IsExistsIsolate() {
        var tableIsolation = document.getElementById("tIsolation");
        if (tableIsolation != null) {
            var txtStatus = tableIsolation.getElementsByTagName("Input");
            for (var i = 0; i < txtStatus.length; i++) {
                if (parseInt(txtStatus[i].value) == 2) {
                    return true;
                }
            }
        }
        return false;
    }

    function IsMatchCompleted() {
        var flag = false;
        var chkRestoreNomal = document.getElementById("UCFirePortection1_chkRestoreNormal");
        var chkRestoreALL = document.getElementById("UCFirePortection1_chkRestoreAll");
        var rblNormalStatus = document.getElementById("UCFirePortection1_rblStatus_0");

        if (rblNormalStatus.checked) {
            if (chkRestoreALL.checked || (!IsExistsIsolate())) {
                flag = true;
            }
        } else {
            if ((!IsExistsIsolate()) && chkRestoreNomal.checked) {
                flag = true;
            }
        }
        return flag;
    }

    function CheckToPopupMessageForZoneGroup() {
        if (action == 2 && stationEventID != -1 && eventStatus == 1) {
            if (IsMatchCompleted()) {
                //Set Restore Control Status
                document.getElementById("UCFirePortection1_ddlRestoreHandleBy").disabled = false;
                document.getElementById("UCFirePortection1_txtRestoreCHUBB").disabled = false;
                document.getElementById("UCFirePortection1_lblRestoreHandleBy").innerHTML += "<em>*</em>";
                var index = document.getElementById("UCFirePortection1_lblFireLinkCoordinator").innerHTML.indexOf("<EM>*</EM>");
                document.getElementById("UCFirePortection1_lblRestoreCHUBB").innerHTML += index > -1 ? "<em>*</em>" : "";

                //Bind Restore Control default Value
                var userId = '<%=this.ODMUser.ID.ToString() %>';
                document.getElementById("UCFirePortection1_ddlRestoreHandleBy").value = userId;
                var CHUBB = document.getElementById("UCFirePortection1_txtFireLinkCoordinator").value;
                document.getElementById("UCFirePortection1_txtRestoreCHUBB").value = CHUBB;

                //add by gordon 20150804 U127.3
                if ($("#UCFirePortection1_rblStatus_0").attr("checked")) {
                    //Check OutStanding Record
                    var f = document.getElementById("UCFirePortection1_ddlFireLink");
                    var fid = f.value;
                    var ftxt = f.options[f.selectedIndex].text;
                    //update by gordon 20151103
                    var url = '<%=ResolveUrl("~")%>' + "SOM/FireProtection/FireProtectionEntry.aspx?mode=CheckOS";
                    //$.post("FireProtectionEntry.aspx?mode=CheckOS", { fid: fid, ftxt: ftxt }, function (msg) {
                    $.post(url, { fid: fid, ftxt: ftxt }, function (msg) {
                        //update end 20151103
                        //update by gordon 20150804 U127.3
                        if (trim(msg) != "") {
                            alert(msg);
                        }
                    });
                }
            } else {
                if (document.getElementById("UCFirePortection1_chkRestoreNormal").checked)
                    document.getElementById("UCFirePortection1_chkRestoreNormal").checked = false;

                //Cleare Time Text
                document.getElementById("UCFirePortection1_lblCompleteRestoreTime").innerHTML = "";

                //Set Restore Control Status
                document.getElementById("UCFirePortection1_ddlRestoreHandleBy").disabled = true;
                document.getElementById("UCFirePortection1_txtRestoreCHUBB").disabled = true;

                //Bind Restore Control default Value
                document.getElementById("UCFirePortection1_ddlRestoreHandleBy").value = 0;
                document.getElementById("UCFirePortection1_txtRestoreCHUBB").value = "";

                var indexHandleBy = document.getElementById("UCFirePortection1_lblRestoreHandleBy").innerHTML.indexOf("<EM>*</EM>");
                if (indexHandleBy > -1) {
                    var lblHandleBy = document.getElementById("UCFirePortection1_lblRestoreHandleBy").innerHTML.toString().substring(0, indexHandleBy);
                    document.getElementById("UCFirePortection1_lblRestoreHandleBy").innerHTML = lblHandleBy;
                }

                var indexCHUBB = document.getElementById("UCFirePortection1_lblRestoreCHUBB").innerHTML.indexOf("<EM>*</EM>");
                if (indexCHUBB > -1) {
                    var lblCHUBB = document.getElementById("UCFirePortection1_lblRestoreCHUBB").innerHTML.toString().substring(0, indexCHUBB);
                    document.getElementById("UCFirePortection1_lblRestoreCHUBB").innerHTML = lblCHUBB;
                }
            }
        }
    }

    function CheckToPopupMessage(msg) {
        if (IsMatchCompleted()) {
            //update by gordon 20150804 U127.3
            if (trim(msg) != "") {
                alert(msg);
            }
        }
    }

    //------------------------------ ------------------------------------
    ///U12.2: add by benson 2015.07.24 begin
    //var staffid = "";
    var staffid = "<%=StrStaffID%>"; //Modified by jack 20150930 for u223
    function SetCursor(url) {
        var reqID = document.getElementById("UCFirePortection1_txtRequestByID");
        if ((reqID.value != "" && reqID.value != staffid) || (reqID.value == "" && staffid != "")) {
            if (reqID.value != staffid) {
                //add by gordon 20151016
                SetCur("wait");
                document.getElementById('CSSCursor').href = url;
            }
            SetStaffInfoEnabled(true);
        }
    }

    function SetCursorOff() {
        document.getElementById('CSSCursor').href = "";
        SetCur(""); //add by gordon 20151016
    }

    //add by gordon 20151016
    function SetCur(cur) {
        if ($("div").length > 0)
            $("div").css("cursor", cur);
        if ($("input").length > 0)
            $("input").css("cursor", cur);
        if ($("span").length > 0)
            $("span").css("cursor", cur);
        if ($("tbpdy").length > 0)
            $("tbpdy").css("cursor", cur);
        if ($("td").length > 0)
            $("td").css("cursor", cur);
        if ($("select").length > 0)
            $("select").css("cursor", cur);
    }

    var ddlStationEnabledStatus = false; //Add by jack 20151209 fixed  u290 issue for enabled ddlstation always
    function SetStaffInfoEnabled(disabled, callby) {
        var PaneConten = document.getElementById("UCFirePortection1_PaneConten");
        PaneConten.disabled = disabled;
        var paneRight = document.getElementById("UCFirePortection1_paneRight");
        paneRight.disabled = disabled;
        //            var phTable = document.getElementById("UCFirePortection1_phTable");
        //            phTable.disabled = disabled;

        var txtIsol = document.getElementById("UCFirePortection1_txtIsolationDuration");
        var txtReqBCN = document.getElementById("UCFirePortection1_txtRequestByContactNumber");
        var txtReqByDept = document.getElementById("UCFirePortection1_txtRequestByDept");
        var txtReqByID = document.getElementById("UCFirePortection1_txtRequestByID");
        var txtReqByName = document.getElementById("UCFirePortection1_txtRequestByName");
        var txtReqByOU = document.getElementById("UCFirePortection1_txtRequestByOU");
        var ddlHandby = document.getElementById("UCFirePortection1_ddlHandledby");
        var btnSeRequest = document.getElementById("UCFirePortection1_btnSelectRequest");
        var ddlFireLink = document.getElementById("UCFirePortection1_ddlFireLink");
        var ddlStation = document.getElementById("UCFirePortection1_ddlStation");

        //Add by jack 20151209 fixed  u276 issue for enabled ddlstation always
        if (!ddlStationEnabledStatus && ddlStation.disabled != "disabled") {
            ddlStationEnabledStatus = true;
        }

        var rblStatus = document.getElementById("UCFirePortection1_rblStatus");
        var chkRestNormal = document.getElementById("UCFirePortection1_chkRestoreNormal");
        var chkHandNot = document.getElementById("UCFirePortection1_chkHandoverNot");
        var txtHandNote = document.getElementById("UCFirePortection1_txtHandoverNote");
        var ddlReason = document.getElementById("UCFirePortection1_ddlReason");
        var txtRemarks = document.getElementById("UCFirePortection1_txtRemarks");
        var chkIsolAll = document.getElementById("UCFirePortection1_chkIsolateAll");
        var chkRestAll = document.getElementById("UCFirePortection1_chkRestoreAll");
        var txtFireCoord = document.getElementById("UCFirePortection1_txtFirelinkCoordinator");
        staffid = txtReqByID.value;
        //var tableIsolation = document.getElementById("UCFirePortection1_tIsolation");
        txtIsol.disabled = disabled;
        // edit by dylan 20151116 for u276 load icon

        if (callby == "1" || callby == 1) {
            txtReqBCN.disabled = disabled;
            txtReqByDept.disabled = disabled;
            txtReqByID.disabled = disabled;
            txtReqByName.disabled = disabled;
            txtHandNote.disabled = disabled;
        }
        txtReqByOU.disabled = disabled;
        ddlHandby.disabled = disabled;
        // edit by dylan 20151116 for u276 load icon
        if (btnSeRequest) {
            btnSeRequest.disabled = disabled;
        }

        //Update by jack 20151211 U290 fixed enabled ddlfirelink when restored all or restored normal
        //ddlFireLink.disabled = disabled;
        if (eventStatus == "0") {
            ddlFireLink.disabled = disabled;
        }

        var hdnStaffType = document.getElementById("UCFirePortection1_hdnStaffType").value;

        if (hdnStaffType == "4" || txtReqByID.value=="") {
            txtReqByName.disabled = false;
            txtReqByDept.disabled = false;
        } else {
            txtReqByName.disabled = true;
            txtReqByDept.disabled = true;
        }

        if (chkRestAll.checked || chkRestNormal.checked) {
            if (eventStatus == "1" && hdnStaffType != "4") {
                txtReqByName.disabled = true;
                txtReqByDept.disabled = true;
            }
        }
        //End update by jack 20151211 U290 fixed enabled ddlfirelink when restored all or restored normal

        //Add by jack 20151209 fixed  u276 issue for enabled ddlstation always
        //ddlStation.disabled = disabled;
        if (ddlStationEnabledStatus) {
            
        } else {
            ddlStation.disabled = disabled;
        }
        
        rblStatus.disabled = disabled;
        chkRestNormal.disabled = disabled;
        chkHandNot.disabled = disabled;

        ddlReason.disabled = disabled;
        txtRemarks.disabled = disabled;
        chkIsolAll.disabled = disabled;
        chkRestAll.disabled = disabled;
        txtFireCoord.disabled = disabled;
        //            tableIsolation.disabled = disabled;
    }
    ///U12.2: add by benson 2015.07.24 end

    // add by jack 20151119 for u284 mouseout do not query data
    function TextChanged(obj) {
        if (obj.fireEvent) {
            obj.fireEvent('onchange');
        }
        else {
            obj.onchange();
        }
    }
    
</script>
<link id="CSSCursor" rel="stylesheet" type="text/css" href="" />
<div style="padding-top: 8px; padding-bottom: 8px; width: 100%">
    <AjaxControlToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server">
    </AjaxControlToolkit:ToolkitScriptManager>
    <asp:UpdatePanel runat="server" ID="panel11">
        <ContentTemplate>
            <table>
                <tr>
                    <td style="width: 336px;" valign="top">
                        <asp:UpdatePanel runat="server" ID="PaneConten">
                            <ContentTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblEventNO"></asp:Label></span> <span style="padding-left: 8px">
                                                    <asp:Label runat="server" ID="lblNOShow"></asp:Label>&nbsp;<img id="imgAssetLoanEventStatus"
                                                        runat="server" src="../../Images/SOM/EventStatus_OS.gif" />&nbsp;<img id="imgAssetLoanEventHighLight"
                                                            runat="server" /></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblStation"></asp:Label><em>*</em></span> <span style="padding-left: 8px">
                                                    <asp:DropDownList runat="server" ID="ddlStation" AutoPostBack="True" OnSelectedIndexChanged="ddlStation_SelectedIndexChanged"
                                                        CssClass="ddlStation">
                                                    </asp:DropDownList>
                                                </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblFireLink"></asp:Label><em>*</em></span> <span style="padding-left: 8px">
                                                    <asp:DropDownList ID="ddlFireLink" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlFireLink_SelectedIndexChanged"
                                                        Width="240px">
                                                    </asp:DropDownList>
                                                </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblIsolationTime"></asp:Label><em>*</em></span>
                                            <span style="padding-left: 8px">
                                                <asp:TextBox runat="server" Width="118px" ID="txtIsolationDateTime" Style="border-left-color: white;
                                                    border-bottom-color: white; border-top-style: none; border-top-color: white;
                                                    border-right-style: none; border-left-style: none; border-right-color: white;
                                                    border-bottom-style: none"></asp:TextBox>
                                                <input id="hdnDateTimeReason" runat="server" type="hidden" />
                                            </span>
                                            <asp:Button ID="btnAmendEventTime" OnClientClick="OpenAmendEventTimeForm();" runat="server"
                                                Text="..." OnClick="btnAmendEventTime_Click" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblIsolationDuration"></asp:Label></span> <span style="padding-left: 8px;
                                                    padding-right: 5px;">
                                                    <%--<asp:TextBox runat="server" Width="40px" ID="txtIsolationDuration" AutoPostBack="True"
                                            OnTextChanged="btnAmendEventTime_Click" MaxLength="10"></asp:TextBox>--%>
                                                    <%-- Issue U05: Update by Gordon 2015/05/21 --%>
                                                    <%-- Issue U05: Update by Dylan 2016/06/17 --%>
                                                    <%--   edit by dylan 20150930 for u91  <asp:TextBox runat="server" Width="40px" ID="txtIsolationDuration" AutoPostBack="True"
                                            OnTextChanged="btnAmendEventTime_Click" MaxLength="10" onkeypress="checkDate2(this,4,1)"></asp:TextBox>--%>
                                                    <asp:TextBox runat="server" Width="40px" ID="txtIsolationDuration" AutoPostBack="True"
                                                        OnTextChanged="btnAmendEventTime_Click" MaxLength="6" onkeypress="checkDate2(this,4,1)"
                                                        onpaste="return checkPasteText(this.value);"></asp:TextBox>
                                                </span>
                                            <asp:Label runat="server" ID="lblHour"></asp:Label>
                                            <span style="padding-left: 8px">
                                                <asp:Label runat="server" ID="lblEstimatedIsolationDate"></asp:Label>
                                                <input id="hdnInitDateTime" runat="server" type="hidden" />
                                            </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblRequestByID"></asp:Label><em runat="server" id="requestByEM">*</em>
                                                <asp:Image ID="imgRequest" runat="server" ImageUrl="../../Images/SOM/StaffType_AddHoc.gif"
                                                    ToolTip="" />
                                            </span>
                                            <%-- Update By Gordon 20150629 --%>
                                            <span style="padding-left: 12px">
                                                <%--<span style="padding-left: 8px">--%>
                                               <%--add by jack 20151119 for u284 mouseout do not query data
                                                   <asp:TextBox runat="server" ID="TextBox1" AutoPostBack="True" onblur="SetCursor('../../CSS/ForAdmRegWaitCursor.css');"
                                                    OnTextChanged="txtRequestByID_TextChanged" MaxLength="20" Width="210px"></asp:TextBox>--%>
                                                <asp:TextBox runat="server" ID="txtRequestByID" AutoPostBack="True" onblur="SetCursor('../../CSS/ForAdmRegWaitCursor.css');TextChanged(this);"
                                                    OnTextChanged="txtRequestByID_TextChanged" MaxLength="20" Width="210px"></asp:TextBox>
                                            </span>
                                            <asp:ImageButton ID="btnSelectRequest" OnClientClick="return OpenStaffByRequest()"
                                                runat="server" ImageUrl="../../Images/Common/view.png" OnClick="btnSelectRequest_Click" />
                                            <input runat="server" id="hdnStaffType" type="hidden" />
                                            <input runat="server" type="hidden" id="hdnRequestStaffOrExtPartyID" />
                                            <input runat="server" type="hidden" id="hdnExtPartyStaffSnapShotID" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblRequestByName"></asp:Label><em runat="server" id="requestByNameEM">*</em></span>
                                            <span style="padding-left: 8px">
                                                <asp:TextBox runat="server" ID="txtRequestByName" MaxLength="50" Width="240px"></asp:TextBox></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblRequestByDeptCompany"></asp:Label><em runat="server"
                                                    id="requestByDeptEM">*</em></span> <span style="padding-left: 8px">
                                                        <asp:TextBox runat="server" ID="txtRequestByDept" MaxLength="200" Width="240px"></asp:TextBox></span>
                                        </td>
                                    </tr>
                                    <tr style="display: none">
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblRequestByOU"></asp:Label></span> <span style="padding-left: 8px;">
                                                    <asp:TextBox runat="server" ID="txtRequestByOU" MaxLength="100" Width="240px" Enabled="False"></asp:TextBox></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblRequestByContactNumber"></asp:Label>
                                                <%-- Issue U38: Add By Gordon 2015/05/28 --%>
                                                <em runat="server" id="requeseByContactNumEM">*</em>
                                                <%-- ----------------------------------- --%>
                                            </span>
                                            <%-- Update By Gordon 20150629 --%>
                                            <%--<span style="padding-left: 8px">--%>
                                            <span style="padding-left: 12px">
                                                <asp:TextBox runat="server" ID="txtRequestByContactNumber" MaxLength="50" Width="240px"></asp:TextBox></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblHandledby"></asp:Label><em>*</em><asp:Image ID="imgResponsibleStaffType"
                                                    runat="server" ImageUrl="../../Images/SOM/StaffType_Staff.gif" /></span>
                                            <span style="padding-left: 8px">
                                                <asp:DropDownList ID="ddlHandledby" runat="server" AutoPostBack="True" Width="240px">
                                                </asp:DropDownList>
                                                &nbsp;
                                                <%-- <asp:ImageButton ID="imgSelectResponsible" OnClientClick="OpenStaffByResponsible();"
                                            runat="server" ImageUrl="../../Images/Common/view.png" OnClick="imgSelectResponsible_Click" Visible="False" />--%>
                                            </span>
                                            <input id="hdnResponsibleByType" runat="server" type="hidden" />
                                            <input runat="server" id="hdnResponsibleByID" type="hidden" />
                                            <input runat="server" type="hidden" id="hdnResponsibleStaffOrExtPartyID" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblFireLinkCoordinator"></asp:Label></span> <span style="padding-left: 8px">
                                                    <asp:TextBox runat="server" ID="txtFirelinkCoordinator" MaxLength="50" Width="240px"></asp:TextBox></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable">
                                                <asp:Label runat="server" ID="lblReason"></asp:Label><em>*</em></span> <span style="padding-left: 8px">
                                                    <asp:DropDownList runat="server" ID="ddlReason" Width="240px">
                                                    </asp:DropDownList>
                                                </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spanLable" style="vertical-align: top; display: inline-block;">
                                                <asp:Label runat="server" ID="lblRemarks"></asp:Label></span> <span style="padding-left: 8px">
                                                    <asp:TextBox runat="server" ID="txtRemarks" TextMode="multiLine" Columns="30" Height="60px"
                                                        Width="240px"></asp:TextBox></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span style="vertical-align: top; width: 86px; display: inline-block; padding-left: 8px;">
                                                <asp:Label runat="server" ID="lblHandoverNote"></asp:Label>
                                            </span><span style="vertical-align: top;">
                                                <asp:CheckBox runat="server" ID="chkHandoverNot" AutoPostBack="True" OnCheckedChanged="chkHandoverNot_CheckedChanged" />
                                            </span><span style="padding-left: 5px;">
                                                <asp:TextBox runat="server" ID="txtHandoverNote" TextMode="multiLine" Columns="30"
                                                    Height="60px" Width="240px"></asp:TextBox>
                                            </span>
                                        </td>
                                    </tr>
                                    <tr valign="top" style="height: 1px;">
                                        <td height="1" valign="top">
                                            <%--<asp:Label ID="Label1" runat="server" Width="374px" Height="1px"></asp:Label>--%>
                                            <div style="width: 374px; height: 1px;">
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                    <td valign="top" style="float: left; padding: 8px;">
                        <asp:UpdatePanel runat="server" ID="paneRight">
                            <ContentTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <span style="padding-left: 8px;">
                                                <asp:Label runat="server" ID="lblAdmissionRegistry"></asp:Label></span> <span style="width: 120px;
                                                    padding-left: 8px">
                                                    <asp:Label ID="lblParentEventNo" runat="server"></asp:Label>&nbsp;
                                                    <img id="imgAssetLoanEventStatusNew" runat="server" src="../../Images/SOM/EventStatus_OS.gif" />
                                                </span><span style="padding-left: 15px"><a href="#" runat="server" id="linkToAdmission">
                                                    <asp:Label runat="server" ID="lblGoToAdmission"></asp:Label></a>
                                        </td>
                                    </tr>
                                    <tr valign="top">
                                        <td align="left">
                                            <fieldset style="margin-bottom: 10px; padding-top: 8px;">
                                                <legend class="title1" style="background-color: Green; width: 97%;">
                                                    <asp:Label runat="server" Font-Bold="True" Font-Size="Small" CssClass="CodeSetupCaptionText"
                                                        ID="lblFieldSetFireSystemStatusControl"></asp:Label>
                                                </legend>
                                                <div>
                                                    <span style="padding-left: 8px">
                                                        <asp:CheckBox runat="server" ID="chkRestoreNormal" AutoPostBack="True" OnCheckedChanged="chkRestoreNormal_CheckedChanged" />
                                                    </span>
                                                    <%-- Delete By Gordon 20150707 U95 --%>
                                                    <%--<span style="padding-left: 8px;">
                                                <asp:Label runat="server" ID="lblRestoreTime"></asp:Label>
                                            </span>
                                            <span>
                                                <asp:Label ID="lblCompleteRestoreTime" runat="server"></asp:Label>
                                            </span>--%>
                                                </div>
                                                <div>
                                                    <span style="padding-left: 8px">
                                                        <asp:Label runat="server" ID="lblStatus"></asp:Label>
                                                    </span><span style="padding-left: 8px">
                                                        <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"
                                                            AutoPostBack="True" OnSelectedIndexChanged="rblStatus_SelectedIndexChanged">
                                                        </asp:RadioButtonList>
                                                    </span>
                                                </div>
                                            </fieldset>
                                        </td>
                                    </tr>
                                    <tr valign="top">
                                        <td>
                                            <%--<td style="height:149px"> Update By Gordon 20150707 U95 --%>
                                            <fieldset style="padding-top: 8px;">
                                                <legend style="background-color: Red; width: 97%;">
                                                    <asp:Label runat="server" Font-Bold="True" Font-Size="Small" CssClass="CodeSetupCaptionText"
                                                        ID="lblFieldSetFireZoneGroupStatusControl"></asp:Label>
                                                </legend>
                                                <div>
                                                    <span style="padding-left: 8px; padding-top: 5px;">
                                                        <asp:CheckBox runat="server" ID="chkRestoreAll" Text="Restore All:" AutoPostBack="True"
                                                            OnCheckedChanged="chkRestoreAll_CheckedChanged" />
                                                    </span><span style="padding-left: 15px; padding-top: 5px;">
                                                        <asp:CheckBox runat="server" ID="chkIsolateAll" Text="Isolate All:" OnCheckedChanged="chkIsolateAll_CheckedChanged"
                                                            AutoPostBack="True" />
                                                    </span>
                                                </div>
                                                <div>
                                                    <span style="padding-left: 8px; padding-top: 5px;">
                                                        <asp:Label runat="server" ID="lblIsolateFireZoneGroup"></asp:Label>
                                                    </span><span style="padding-top: 5px;">
                                                        <table style="clear: both; display: inline; direction: ltr;" cellpadding="0" cellspacing="0"
                                                            border="1">
                                                            <tr>
                                                                <td class="NormalLable">
                                                                    <asp:Label runat="server" ID="lblNormal" Text="Testing"></asp:Label>
                                                                </td>
                                                                <td class="IsolationLable">
                                                                    <asp:Label ID="lblIsolate" Text="Isolate" runat="server"></asp:Label>
                                                                </td>
                                                                <td class="RestoreLable">
                                                                    <asp:Label ID="lblRestore" runat="server" Text="Restore"></asp:Label>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </span>
                                                </div>
                                                <div style="padding-left: 8px; padding-top: 5px; padding-bottom: 8px;">
                                                    <%--<asp:Label ID="lblFireZoneGroupPanel" runat="server" ></asp:Label>--%>
                                                    <asp:PlaceHolder ID="phTable" runat="server"></asp:PlaceHolder>
                                                    <input id="txtFireZonePanelData" type="hidden" runat="server" />
                                                </div>
                                            </fieldset>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding-top: 15px">
                                            <span>
                                                <asp:Label runat="server" ID="lblRestoreTime"></asp:Label>
                                            </span><span>
                                                <asp:Label ID="lblCompleteRestoreTime" runat="server"></asp:Label>
                                            </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <%-- Delete By Gordon 20150707 U95 <div style="width:360px;height:1px;">
                                    <input runat="server" id="hdnLastID" type="hidden" />
                                    </div>--%>
                                            <%-- Add by gordon 20150707 U95 --%>
                                            <span>
                                                <%-- Update by gordon 20150803 U128.1 --%>
                                                <%--<asp:Label ID="lblRestoreHandleBy" Width="118px" runat="server" Text="Restore Handle By:"></asp:Label>--%>
                                                <asp:Label ID="lblRestoreHandleBy" Width="80px" runat="server" Text="Restore Handle By:"></asp:Label>
                                            </span><span>
                                                <asp:DropDownList ID="ddlRestoreHandleBy" Enabled="false" Width="180px" runat="server">
                                                </asp:DropDownList>
                                            </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <%-- Add by gordon 20150707 U95 --%>
                                            <span>
                                                <%-- Update by gordon 20150803 U128.1 --%>
                                                <%--<asp:Label ID="lblRestoreCHUBB" runat="server" Width="110px" Text="Restore CHUBB:"></asp:Label>--%>
                                                <asp:Label ID="lblRestoreCHUBB" Width="72px" runat="server" Text="Restore CHUBB:"></asp:Label>
                                            </span><span style="padding-left: 8px">
                                                <asp:TextBox ID="txtRestoreCHUBB" MaxLength="50" Enabled="false" Width="175px" runat="server"></asp:TextBox>
                                            </span>
                                        </td>
                                    </tr>
                                </table>
                                <input runat="server" id="hdnImgStaffTypeTooltip1" type="hidden" />
                                <input runat="server" id="hdnImgStaffTypeTooltip2" type="hidden" />
                                <input runat="server" id="hdnImgStaffTypeTooltip3" type="hidden" />
                                <input runat="server" id="hdnImgStaffTypeTooltip4" type="hidden" />
                                <input runat="server" id="hdnStationEventLastUpdataTime" type="hidden" />
                                <input runat="server" id="hidAutomaticallyAssignTestoreTime" type="hidden" />
                                <input runat="server" id="hdnTMPID" type="hidden" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
